home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / X11 / XCreateGC.z / XCreateGC
Encoding:
Text File  |  2002-10-03  |  38.5 KB  |  1,101 lines

  1.  
  2.  
  3.  
  4.      XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))    XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))     XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XCreateGC, XCopyGC, XChangeGC, XGetGCValues, XFreeGC,
  10.           XGContextFromGC, XGCValues - create or free graphics
  11.           contexts and graphics context structure
  12.  
  13.      SSSSYYYYNNNNTTTTAAAAXXXX
  14.           GC XCreateGC(_d_i_s_p_l_a_y, _d, _v_a_l_u_e_m_a_s_k, _v_a_l_u_e_s)
  15.                 Display *_d_i_s_p_l_a_y;
  16.                 Drawable _d;
  17.                 unsigned long _v_a_l_u_e_m_a_s_k;
  18.                 XGCValues *_v_a_l_u_e_s;
  19.  
  20.           XCopyGC(_d_i_s_p_l_a_y, _s_r_c, _v_a_l_u_e_m_a_s_k, _d_e_s_t)
  21.                 Display *_d_i_s_p_l_a_y;
  22.                 GC _s_r_c, _d_e_s_t;
  23.                 unsigned long _v_a_l_u_e_m_a_s_k;
  24.  
  25.           XChangeGC(_d_i_s_p_l_a_y, _g_c, _v_a_l_u_e_m_a_s_k, _v_a_l_u_e_s)
  26.                 Display *_d_i_s_p_l_a_y;
  27.                 GC _g_c;
  28.                 unsigned long _v_a_l_u_e_m_a_s_k;
  29.                 XGCValues *_v_a_l_u_e_s;
  30.  
  31.           Status XGetGCValues(_d_i_s_p_l_a_y, _g_c, _v_a_l_u_e_m_a_s_k, _v_a_l_u_e_s__r_e_t_u_r_n)
  32.                 Display *_d_i_s_p_l_a_y;
  33.                 GC _g_c;
  34.                 unsigned long _v_a_l_u_e_m_a_s_k;
  35.                 XGCValues *_v_a_l_u_e_s__r_e_t_u_r_n;
  36.  
  37.           XFreeGC(_d_i_s_p_l_a_y, _g_c)
  38.                 Display *_d_i_s_p_l_a_y;
  39.                 GC _g_c;
  40.  
  41.           GContext XGContextFromGC(_g_c)
  42.                 GC _g_c;
  43.  
  44.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  45.           _d         Specifies the drawable.
  46.  
  47.           _d_e_s_t      Specifies the destination GC.
  48.  
  49.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  50.  
  51.           _g_c        Specifies the GC.
  52.  
  53.           _s_r_c       Specifies the components of the source GC.
  54.  
  55.           _v_a_l_u_e_m_a_s_k Specifies which components in the GC are to be
  56.                     set, copied, changed, or returned . This argument
  57.                     is the bitwise inclusive OR of zero or more of the
  58.                     valid GC component mask bits.
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 10/3/02)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))    XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))     XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.           _v_a_l_u_e_s    Specifies any values as specified by the
  75.                     valuemask.
  76.  
  77.           _v_a_l_u_e_s__r_e_t_u_r_n
  78.                     Returns the GC values in the specified _X_G_C_V_a_l_u_e_s
  79.                     structure.
  80.  
  81.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  82.           The _X_C_r_e_a_t_e_G_C function creates a graphics context and
  83.           returns a GC.  The GC can be used with any destination
  84.           drawable having the same root and depth as the specified
  85.           drawable.  Use with other drawables results in a _B_a_d_M_a_t_c_h
  86.           error.
  87.  
  88.           _X_C_r_e_a_t_e_G_C can generate _B_a_d_A_l_l_o_c, _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_F_o_n_t,
  89.           _B_a_d_M_a_t_c_h, _B_a_d_P_i_x_m_a_p, and _B_a_d_V_a_l_u_e errors.
  90.  
  91.           The _X_C_o_p_y_G_C function copies the specified components from
  92.           the source GC to the destination GC.  The source and
  93.           destination GCs must have the same root and depth, or a
  94.           _B_a_d_M_a_t_c_h error results.  The valuemask specifies which
  95.           component to copy, as for _X_C_r_e_a_t_e_G_C.
  96.  
  97.           _X_C_o_p_y_G_C can generate _B_a_d_A_l_l_o_c, _B_a_d_G_C, and _B_a_d_M_a_t_c_h errors.
  98.  
  99.           The _X_C_h_a_n_g_e_G_C function changes the components specified by
  100.           valuemask for the specified GC.  The values argument
  101.           contains the values to be set.  The values and restrictions
  102.           are the same as for _X_C_r_e_a_t_e_G_C.  Changing the clip-mask
  103.           overrides any previous _X_S_e_t_C_l_i_p_R_e_c_t_a_n_g_l_e_s request on the
  104.           context. Changing the dash-offset or dash-list overrides any
  105.           previous _X_S_e_t_D_a_s_h_e_s request on the context.  The order in
  106.           which components are verified and altered is server
  107.           dependent.  If an error is generated, a subset of the
  108.           components may have been altered.
  109.  
  110.           _X_C_h_a_n_g_e_G_C can generate _B_a_d_A_l_l_o_c, _B_a_d_F_o_n_t, _B_a_d_G_C, _B_a_d_M_a_t_c_h,
  111.           _B_a_d_P_i_x_m_a_p, and _B_a_d_V_a_l_u_e errors.
  112.  
  113.           The _X_G_e_t_G_C_V_a_l_u_e_s function returns the components specified
  114.           by valuemask for the specified GC.  If the valuemask
  115.           contains a valid set of GC mask bits (_G_C_F_u_n_c_t_i_o_n,
  116.           _G_C_P_l_a_n_e_M_a_s_k, _G_C_F_o_r_e_g_r_o_u_n_d, _G_C_B_a_c_k_g_r_o_u_n_d, _G_C_L_i_n_e_W_i_d_t_h,
  117.           _G_C_L_i_n_e_S_t_y_l_e, _G_C_C_a_p_S_t_y_l_e, _G_C_J_o_i_n_S_t_y_l_e, _G_C_F_i_l_l_S_t_y_l_e,
  118.           _G_C_F_i_l_l_R_u_l_e, _G_C_T_i_l_e, _G_C_S_t_i_p_p_l_e, _G_C_T_i_l_e_S_t_i_p_X_O_r_i_g_i_n,
  119.           _G_C_T_i_l_e_S_t_i_p_Y_O_r_i_g_i_n, _G_C_F_o_n_t, _G_C_S_u_b_w_i_n_d_o_w_M_o_d_e,
  120.           _G_C_G_r_a_p_h_i_c_s_E_x_p_o_s_u_r_e_s, _G_C_C_l_i_p_X_O_r_i_g_i_n, _G_C_C_L_i_p_Y_O_r_i_g_i_n,
  121.           _G_C_D_a_s_h_O_f_f_s_e_t, or _G_C_A_r_c_M_o_d_e) and no error occurs,
  122.           _X_G_e_t_G_C_V_a_l_u_e_s sets the requested components in values_return
  123.           and returns a nonzero status.  Otherwise, it returns a zero
  124.           status.  Note that the clip-mask and dash-list (represented
  125.           by the _G_C_C_l_i_p_M_a_s_k and _G_C_D_a_s_h_L_i_s_t bits, respectively, in the
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 10/3/02)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))    XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))     XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           valuemask) cannot be requested.  Also note that an invalid
  141.           resource ID (with one or more of the three most significant
  142.           bits set to 1) will be returned for _G_C_F_o_n_t, _G_C_T_i_l_e, and
  143.           _G_C_S_t_i_p_p_l_e if the component has never been explicitly set by
  144.           the client.
  145.  
  146.           The _X_F_r_e_e_G_C function destroys the specified GC as well as
  147.           all the associated storage.
  148.  
  149.           _X_F_r_e_e_G_C can generate a _B_a_d_G_C error.
  150.  
  151.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  152.           The _X_G_C_V_a_l_u_e_s structure contains:
  153.  
  154.           /* GC attribute value mask bits */
  155.                     _G_C_F_u_n_c_t_i_o_n
  156.                                                 (1L<<0)
  157.           #define
  158.                     _G_C_P_l_a_n_e_M_a_s_k
  159.                                                 (1L<<1)
  160.           #define
  161.                     _G_C_F_o_r_e_g_r_o_u_n_d
  162.                                                 (1L<<2)
  163.           #define
  164.                     _G_C_B_a_c_k_g_r_o_u_n_d
  165.                                                 (1L<<3)
  166.           #define
  167.                     _G_C_L_i_n_e_W_i_d_t_h
  168.                                                 (1L<<4)
  169.           #define
  170.                     _G_C_L_i_n_e_S_t_y_l_e
  171.                                                 (1L<<5)
  172.           #define
  173.                     _G_C_C_a_p_S_t_y_l_e
  174.                                                 (1L<<6)
  175.           #define
  176.                     _G_C_J_o_i_n_S_t_y_l_e
  177.                                                 (1L<<7)
  178.           #define
  179.                     _G_C_F_i_l_l_S_t_y_l_e
  180.                                                 (1L<<8)
  181.           #define
  182.                     _G_C_F_i_l_l_R_u_l_e
  183.                                                 (1L<<9)
  184.           #define
  185.                     _G_C_T_i_l_e
  186.                                                 (1L<<10)
  187.           #define
  188.                     _G_C_S_t_i_p_p_l_e
  189.                                                 (1L<<11)
  190.           #define
  191.                     _G_C_T_i_l_e_S_t_i_p_X_O_r_i_g_i_n
  192.                                                 (1L<<12)
  193.           #define
  194.                     _G_C_T_i_l_e_S_t_i_p_Y_O_r_i_g_i_n
  195.                                                 (1L<<13)
  196.           #define
  197.                     _G_C_F_o_n_t
  198.                                                 (1L<<14)
  199.           #define
  200.                     _G_C_S_u_b_w_i_n_d_o_w_M_o_d_e
  201.                                                 (1L<<15)
  202.           #define
  203.                     _G_C_G_r_a_p_h_i_c_s_E_x_p_o_s_u_r_e_s
  204.                                                 (1L<<16)
  205.           #define
  206.                     _G_C_C_l_i_p_X_O_r_i_g_i_n
  207.                                                 (1L<<17)
  208.           #define
  209.                     _G_C_C_l_i_p_Y_O_r_i_g_i_n
  210.                                                 (1L<<18)
  211.           #define
  212.                     _G_C_C_l_i_p_M_a_s_k
  213.                                                 (1L<<19)
  214.           #define
  215.                     _G_C_D_a_s_h_O_f_f_s_e_t
  216.                                                 (1L<<20)
  217.           #define
  218.                     _G_C_D_a_s_h_L_i_s_t
  219.                                                 (1L<<21)
  220.           #define
  221.                     _G_C_A_r_c_M_o_d_e
  222.                                                 (1L<<22)
  223.           #define
  224.           /* Values */
  225.  
  226.           typedef struct {
  227.                int function;            /* logical operation */
  228.                unsigned long plane_mask;/* plane mask */
  229.                unsigned long foreground;/* foreground pixel */
  230.                unsigned long background;/* background pixel */
  231.                int line_width;          /* line width (in pixels) */
  232.                int line_style;          /* LineSolid, LineOnOffDash, LineDoubleDash */
  233.                int cap_style;           /* CapNotLast, CapButt, CapRound, CapProjecting */
  234.                int join_style;          /* JoinMiter, JoinRound, JoinBevel */
  235.                int fill_style;          /* FillSolid, FillTiled, FillStippled FillOpaqueStippled*/
  236.                int fill_rule;           /* EvenOddRule, WindingRule */
  237.                int arc_mode;            /* ArcChord, ArcPieSlice */
  238.  
  239.  
  240.  
  241.      Page 3                                          (printed 10/3/02)
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.      XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))    XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))     XXXXCCCCrrrreeeeaaaatttteeeeGGGGCCCC((((3333XXXX11111111))))
  249.  
  250.  
  251.  
  252.                Pixmap tile;             /* tile pixmap for tiling operations */
  253.                Pixmap stipple;          /* stipple 1 plane pixmap for stippling */
  254.                int ts_x_origin;         /* offset for tile or stipple operations */
  255.                int ts_y_origin;
  256.                Font font;               /* default text font for text operations */
  257.                int subwindow_mode;      /* ClipByChildren, IncludeInferiors */
  258.                Bool graphics_exposures; /* boolean, should exposures be generated */
  259.                int clip_x_origin;       /* origin for clipping */
  260.                int clip_y_origin;
  261.                Pixmap clip_mask;        /* bitmap clipping; other calls for rects */
  262.                int dash_offset;         /* patterned/dashed line information */
  263.                char dashes;
  264.           } XGCValues;
  265.  
  266.           The function attributes of a GC are used when you update a
  267.           section of a drawable (the destination) with bits from
  268.           somewhere else (the source). The function in a GC defines
  269.           how the new destination bits are to be computed from the
  270.           source bits and the old destination bits.  _G_X_c_o_p_y is
  271.           typically the most useful because it will work on a color
  272.           display, but special applications may use other functions,
  273.           particularly in concert with particular planes of a color
  274.           display.  The 16 GC functions, defined in <_X_1_1/_X._h>, are:
  275.           ______________________________________________
  276.           FFFFuuuunnnnccccttttiiiioooonnnn NNNNaaaammmmeeee     VVVVaaaalllluuuueeee   OOOOppppeeeerrrraaaattttiiiioooonnnn
  277.           ______________________________________________
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.      Page 4                                          (printed 10/3/02)
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  312.  
  313.  
  314.  
  315.           _G_X_c_l_e_a_r
  316.                              0x0
  317.                                     0
  318.           _G_X_a_n_d
  319.                              0x1
  320.                                     src AND dst
  321.           _G_X_a_n_d_R_e_v_e_r_s_e
  322.                              0x2
  323.                                     src AND NOT dst
  324.           _G_X_c_o_p_y
  325.                              0x3
  326.                                     src
  327.           _G_X_a_n_d_I_n_v_e_r_t_e_d
  328.                              0x4
  329.                                     (NOT src) AND dst
  330.           _G_X_n_o_o_p
  331.                              0x5
  332.                                     dst
  333.           _G_X_x_o_r
  334.                              0x6
  335.                                     src XOR dst
  336.           _G_X_o_r
  337.                              0x7
  338.                                     src OR dst
  339.           _G_X_n_o_r
  340.                              0x8
  341.                                     (NOT src) AND (NOT
  342.                                     dst)
  343.  
  344.           _G_X_e_q_u_i_v
  345.                              0x9
  346.                                     (NOT src) XOR dst
  347.           _G_X_i_n_v_e_r_t
  348.                              0xa
  349.                                     NOT dst
  350.           _G_X_o_r_R_e_v_e_r_s_e
  351.                              0xb
  352.                                     src OR (NOT dst)
  353.           _G_X_c_o_p_y_I_n_v_e_r_t_e_d
  354.                              0xc
  355.                                     NOT src
  356.           _G_X_o_r_I_n_v_e_r_t_e_d
  357.                              0xd
  358.                                     (NOT src) OR dst
  359.           _G_X_n_a_n_d
  360.                              0xe
  361.                                     (NOT src) OR (NOT
  362.                                     dst)
  363.  
  364.           _G_X_s_e_t
  365.                              0xf
  366.                                     1
  367.           ______________________________________________
  368.  
  369.           Many graphics operations depend on either pixel values or
  370.           planes in a GC.  The planes attribute is of type long, and
  371.           it specifies which planes of the destination are to be
  372.           modified, one bit per plane.  A monochrome display has only
  373.           one plane and will be the least significant bit of the word.
  374.           As planes are added to the display hardware, they will
  375.           occupy more significant bits in the plane mask.
  376.  
  377.           In graphics operations, given a source and destination
  378.           pixel, the result is computed bitwise on corresponding bits
  379.           of the pixels.  That is, a Boolean operation is performed in
  380.           each bit plane. The plane_mask restricts the operation to a
  381.           subset of planes.  A macro constant _A_l_l_P_l_a_n_e_s can be used to
  382.           refer to all planes of the screen simultaneously.  The
  383.           result is computed by the following:
  384.  
  385.           ((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask))
  386.  
  387.           Range checking is not performed on the values for
  388.           foreground, background, or plane_mask.  They are simply
  389.           truncated to the appropriate number of bits.  The line-width
  390.           is measured in pixels and either can be greater than or
  391.           equal to one (wide line) or can be the special value zero
  392.           (thin line).
  393.  
  394.           Wide lines are drawn centered on the path described by the
  395.           graphics request.  Unless otherwise specified by the join-
  396.           style or cap-style, the bounding box of a wide line with
  397.           endpoints [x1, y1], [x2, y2] and width w is a rectangle with
  398.           vertices at the following real coordinates:
  399.  
  400.           [x1-(w*sn/2), y1+(w*cs/2)], [x1+(w*sn/2), y1-(w*cs/2)],
  401.  
  402.  
  403.  
  404.      Page 1                                          (printed 10/3/02)
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  412.  
  413.  
  414.  
  415.           [x2-(w*sn/2), y2+(w*cs/2)], [x2+(w*sn/2), y2-(w*cs/2)]
  416.  
  417.           Here sn is the sine of the angle of the line, and cs is the
  418.           cosine of the angle of the line.  A pixel is part of the
  419.           line and so is drawn if the center of the pixel is fully
  420.           inside the bounding box (which is viewed as having
  421.           infinitely thin edges).  If the center of the pixel is
  422.           exactly on the bounding box, it is part of the line if and
  423.           only if the interior is immediately to its right (x
  424.           increasing direction).  Pixels with centers on a horizontal
  425.           edge are a special case and are part of the line if and only
  426.           if the interior or the boundary is immediately below (y
  427.           increasing direction) and the interior or the boundary is
  428.           immediately to the right (x increasing direction).
  429.  
  430.           Thin lines (zero line-width) are one-pixel-wide lines drawn
  431.           using an unspecified, device-dependent algorithm.  There are
  432.           only two constraints on this algorithm.
  433.  
  434.           1.   If a line is drawn unclipped from [x1,y1] to [x2,y2]
  435.                and if another line is drawn unclipped from
  436.                [x1+dx,y1+dy] to [x2+dx,y2+dy], a point [x,y] is
  437.                touched by drawing the first line if and only if the
  438.                point [x+dx,y+dy] is touched by drawing the second
  439.                line.
  440.  
  441.           2.   The effective set of points comprising a line cannot be
  442.                affected by clipping.  That is, a point is touched in a
  443.                clipped line if and only if the point lies inside the
  444.                clipping region and the point would be touched by the
  445.                line when drawn unclipped.
  446.  
  447.           A wide line drawn from [x1,y1] to [x2,y2] always draws the
  448.           same pixels as a wide line drawn from [x2,y2] to [x1,y1],
  449.           not counting cap-style and join-style.  It is recommended
  450.           that this property be true for thin lines, but this is not
  451.           required.  A line-width of zero may differ from a line-width
  452.           of one in which pixels are drawn.  This permits the use of
  453.           many manufacturers' line drawing hardware, which may run
  454.           many times faster than the more precisely specified wide
  455.           lines.
  456.  
  457.           In general, drawing a thin line will be faster than drawing
  458.           a wide line of width one.  However, because of their
  459.           different drawing algorithms, thin lines may not mix well
  460.           aesthetically with wide lines.  If it is desirable to obtain
  461.           precise and uniform results across all displays, a client
  462.           should always use a line-width of one rather than a line-
  463.           width of zero.
  464.  
  465.           The line-style defines which sections of a line are drawn:
  466.           _L_i_n_e_S_o_l_i_d
  467.  
  468.  
  469.  
  470.      Page 2                                          (printed 10/3/02)
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  478.  
  479.  
  480.  
  481.                            The full path of the line is drawn.
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.      Page 3                                          (printed 10/3/02)
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.      Page 4                                          (printed 10/3/02)
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  610.  
  611.  
  612.  
  613.           _L_i_n_e_D_o_u_b_l_e_D_a_s_h
  614.                            The full path of the line is drawn, but the
  615.                            even dashes are filled differently from the
  616.                            odd dashes (see fill-style) with _C_a_p_B_u_t_t
  617.                            style used where even and odd dashes meet.
  618.  
  619.  
  620.  
  621.           _L_i_n_e_O_n_O_f_f_D_a_s_h
  622.                            Only the even dashes are drawn, and cap-style
  623.                            applies to all internal ends of the
  624.                            individual dashes, except _C_a_p_N_o_t_L_a_s_t is
  625.                            treated as _C_a_p_B_u_t_t.
  626.  
  627.  
  628.  
  629.  
  630.           The cap-style defines how the endpoints of a path are drawn:
  631.           _C_a_p_N_o_t_L_a_s_t
  632.                           This is equivalent to _C_a_p_B_u_t_t except that for
  633.                           a line-width of zero the final endpoint is
  634.                           not drawn.
  635.  
  636.  
  637.           _C_a_p_B_u_t_t
  638.                           The line is square at the endpoint
  639.                           (perpendicular to the slope of the line) with
  640.                           no projection beyond.
  641.  
  642.  
  643.           _C_a_p_R_o_u_n_d
  644.                           The line has a circular arc with the diameter
  645.                           equal to the line-width, centered on the
  646.                           endpoint.  (This is equivalent to _C_a_p_B_u_t_t for
  647.                           line-width of zero).
  648.  
  649.  
  650.  
  651.           _C_a_p_P_r_o_j_e_c_t_i_n_g
  652.                           The line is square at the end, but the path
  653.                           continues beyond the endpoint for a distance
  654.                           equal to half the line-width.  (This is
  655.                           equivalent to _C_a_p_B_u_t_t for line-width of
  656.                           zero).
  657.  
  658.  
  659.  
  660.  
  661.  
  662.           The join-style defines how corners are drawn for wide lines:
  663.           _J_o_i_n_M_i_t_e_r
  664.                           The outer edges of two lines extend to meet
  665.                           at an angle.  However, if the angle is less
  666.                           than 11 degrees, then a _J_o_i_n_B_e_v_e_l join-style
  667.                           is used instead.
  668.  
  669.  
  670.  
  671.           _J_o_i_n_R_o_u_n_d
  672.                           The corner is a circular arc with the
  673.                           diameter equal to the line-width, centered on
  674.                           the joinpoint.
  675.  
  676.  
  677.           _J_o_i_n_B_e_v_e_l
  678.                           The corner has _C_a_p_B_u_t_t endpoint styles with
  679.                           the triangular notch filled.
  680.  
  681.  
  682.           For a line with coincident endpoints (x1=x2, y1=y2), when
  683.           the cap-style is applied to both endpoints, the semantics
  684.           depends on the line-width and the cap-style:
  685.           _C_a_p_N_o_t_L_a_s_t
  686.                           thin
  687.                                   The results are device dependent, but
  688.                                   the desired effect is that nothing is
  689.                                   drawn.
  690.  
  691.  
  692.           _C_a_p_B_u_t_t
  693.                           thin
  694.                                   The results are device dependent, but
  695.                                   the desired effect is that a single
  696.                                   pixel is drawn.
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.      Page 5                                          (printed 10/3/02)
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  711.  
  712.  
  713.  
  714.           _C_a_p_R_o_u_n_d
  715.                           thin
  716.                                   The results are the same as for
  717.                                   _C_a_p_B_u_t_t/thin.
  718.  
  719.           _C_a_p_P_r_o_j_e_c_t_i_n_g
  720.                           thin
  721.                                   The results are the same as for
  722.                                   _C_a_p_B_u_t_t/thin.
  723.  
  724.           _C_a_p_B_u_t_t
  725.                           wide
  726.                                   Nothing is drawn.
  727.           _C_a_p_R_o_u_n_d
  728.                           wide
  729.                                   The closed path is a circle, centered at
  730.                                   the endpoint, and with the diameter
  731.                                   equal to the line-width.
  732.  
  733.  
  734.           _C_a_p_P_r_o_j_e_c_t_i_n_g
  735.                           wide
  736.                                   The closed path is a square, aligned
  737.                                   with the coordinate axes, centered at
  738.                                   the endpoint, and with the sides equal
  739.                                   to the line-width.
  740.  
  741.  
  742.  
  743.  
  744.           For a line with coincident endpoints (x1=x2, y1=y2), when
  745.           the join-style is applied at one or both endpoints, the
  746.           effect is as if the line was removed from the overall path.
  747.           However, if the total path consists of or is reduced to a
  748.           single point joined with itself, the effect is the same as
  749.           when the cap-style is applied at both endpoints.
  750.  
  751.           The tile/stipple represents an infinite two-dimensional
  752.           plane, with the tile/stipple replicated in all dimensions.
  753.           When that plane is superimposed on the drawable for use in a
  754.           graphics operation, the upper-left corner of some instance
  755.           of the tile/stipple is at the coordinates within the
  756.           drawable specified by the tile/stipple origin.  The
  757.           tile/stipple and clip origins are interpreted relative to
  758.           the origin of whatever destination drawable is specified in
  759.           a graphics request.  The tile pixmap must have the same root
  760.           and depth as the GC, or a _B_a_d_M_a_t_c_h error results.  The
  761.           stipple pixmap must have depth one and must have the same
  762.           root as the GC, or a _B_a_d_M_a_t_c_h error results. For stipple
  763.           operations where the fill-style is _F_i_l_l_S_t_i_p_p_l_e_d but not
  764.           _F_i_l_l_O_p_a_q_u_e_S_t_i_p_p_l_e_d, the stipple pattern is tiled in a single
  765.           plane and acts as an additional clip mask to be ANDed with
  766.           the clip-mask.  Although some sizes may be faster to use
  767.           than others, any size pixmap can be used for tiling or
  768.           stippling.
  769.  
  770.           The fill-style defines the contents of the source for line,
  771.           text, and fill requests. For all text and fill requests (for
  772.           example, _X_D_r_a_w_T_e_x_t, _X_D_r_a_w_T_e_x_t_1_6, _X_F_i_l_l_R_e_c_t_a_n_g_l_e,
  773.           _X_F_i_l_l_P_o_l_y_g_o_n, and _X_F_i_l_l_A_r_c); for line requests with line-
  774.           style _L_i_n_e_S_o_l_i_d (for example, _X_D_r_a_w_L_i_n_e, _X_D_r_a_w_S_e_g_m_e_n_t_s,
  775.           _X_D_r_a_w_R_e_c_t_a_n_g_l_e, _X_D_r_a_w_A_r_c); and for the even dashes for line
  776.           requests with line-style _L_i_n_e_O_n_O_f_f_D_a_s_h or _L_i_n_e_D_o_u_b_l_e_D_a_s_h,
  777.           the following apply:
  778.           _F_i_l_l_S_o_l_i_d
  779.  
  780.  
  781.  
  782.  
  783.  
  784.      Page 6                                          (printed 10/3/02)
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  792.  
  793.  
  794.  
  795.                                Foreground
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.      Page 7                                          (printed 10/3/02)
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  858.  
  859.  
  860.  
  861.           _F_i_l_l_T_i_l_e_d
  862.                                Tile
  863.           _F_i_l_l_O_p_a_q_u_e_S_t_i_p_p_l_e_d
  864.                                A tile with the same width and height as
  865.                                stipple, but with background everywhere
  866.                                stipple has a zero and with foreground
  867.                                everywhere stipple has a one
  868.  
  869.  
  870.  
  871.           _F_i_l_l_S_t_i_p_p_l_e_d
  872.                                Foreground masked by stipple
  873.  
  874.           When drawing lines with line-style _L_i_n_e_D_o_u_b_l_e_D_a_s_h, the odd
  875.           dashes are controlled by the fill-style in the following
  876.           manner:
  877.           _F_i_l_l_S_o_l_i_d
  878.                                Background
  879.           _F_i_l_l_T_i_l_e_d
  880.                                Same as for even dashes
  881.           _F_i_l_l_O_p_a_q_u_e_S_t_i_p_p_l_e_d
  882.                                Same as for even dashes
  883.           _F_i_l_l_S_t_i_p_p_l_e_d
  884.                                Background masked by stipple
  885.  
  886.           Storing a pixmap in a GC might or might not result in a copy
  887.           being made.  If the pixmap is later used as the destination
  888.           for a graphics request, the change might or might not be
  889.           reflected in the GC.  If the pixmap is used simultaneously
  890.           in a graphics request both as a destination and as a tile or
  891.           stipple, the results are undefined.
  892.  
  893.           For optimum performance, you should draw as much as possible
  894.           with the same GC (without changing its components).  The
  895.           costs of changing GC components relative to using different
  896.           GCs depend on the display hardware and the server
  897.           implementation.  It is quite likely that some amount of GC
  898.           information will be cached in display hardware and that such
  899.           hardware can only cache a small number of GCs.
  900.  
  901.           The dashes value is actually a simplified form of the more
  902.           general patterns that can be set with _X_S_e_t_D_a_s_h_e_s.
  903.           Specifying a value of N is equivalent to specifying the
  904.           two-element list [N, N] in _X_S_e_t_D_a_s_h_e_s.  The value must be
  905.           nonzero, or a _B_a_d_V_a_l_u_e error results.
  906.  
  907.           The clip-mask restricts writes to the destination drawable.
  908.           If the clip-mask is set to a pixmap, it must have depth one
  909.           and have the same root as the GC, or a _B_a_d_M_a_t_c_h error
  910.           results.  If clip-mask is set to _N_o_n_e, the pixels are always
  911.           drawn regardless of the clip origin.  The clip-mask also can
  912.           be set by calling the _X_S_e_t_C_l_i_p_R_e_c_t_a_n_g_l_e_s or _X_S_e_t_R_e_g_i_o_n
  913.           functions.  Only pixels where the clip-mask has a bit set to
  914.           1 are drawn. Pixels are not drawn outside the area covered
  915.           by the clip-mask or where the clip-mask has a bit set to 0.
  916.           The clip-mask affects all graphics requests.  The clip-mask
  917.           does not clip sources.  The clip-mask origin is interpreted
  918.           relative to the origin of whatever destination drawable is
  919.           specified in a graphics request.
  920.  
  921.  
  922.      Page 8                                          (printed 10/3/02)
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  930.  
  931.  
  932.  
  933.           You can set the subwindow-mode to _C_l_i_p_B_y_C_h_i_l_d_r_e_n or
  934.           _I_n_c_l_u_d_e_I_n_f_e_r_i_o_r_s.  For _C_l_i_p_B_y_C_h_i_l_d_r_e_n, both source and
  935.           destination windows are additionally clipped by all viewable
  936.           _I_n_p_u_t_O_u_t_p_u_t children. For _I_n_c_l_u_d_e_I_n_f_e_r_i_o_r_s, neither source
  937.           nor destination window is clipped by inferiors. This will
  938.           result in including subwindow contents in the source and
  939.           drawing through subwindow boundaries of the destination.
  940.           The use of _I_n_c_l_u_d_e_I_n_f_e_r_i_o_r_s on a window of one depth with
  941.           mapped inferiors of differing depth is not illegal, but the
  942.           semantics are undefined by the core protocol.
  943.  
  944.           The fill-rule defines what pixels are inside (drawn) for
  945.           paths given in _X_F_i_l_l_P_o_l_y_g_o_n requests and can be set to
  946.           _E_v_e_n_O_d_d_R_u_l_e or _W_i_n_d_i_n_g_R_u_l_e.  For _E_v_e_n_O_d_d_R_u_l_e, a point is
  947.           inside if an infinite ray with the point as origin crosses
  948.           the path an odd number of times. For _W_i_n_d_i_n_g_R_u_l_e, a point is
  949.           inside if an infinite ray with the point as origin crosses
  950.           an unequal number of clockwise and counterclockwise directed
  951.           path segments.  A clockwise directed path segment is one
  952.           that crosses the ray from left to right as observed from the
  953.           point.  A counterclockwise segment is one that crosses the
  954.           ray from right to left as observed from the point.  The case
  955.           where a directed line segment is coincident with the ray is
  956.           uninteresting because you can simply choose a different ray
  957.           that is not coincident with a segment.
  958.  
  959.           For both _E_v_e_n_O_d_d_R_u_l_e and _W_i_n_d_i_n_g_R_u_l_e, a point is infinitely
  960.           small, and the path is an infinitely thin line. A pixel is
  961.           inside if the center point of the pixel is inside and the
  962.           center point is not on the boundary. If the center point is
  963.           on the boundary, the pixel is inside if and only if the
  964.           polygon interior is immediately to its right (x increasing
  965.           direction). Pixels with centers on a horizontal edge are a
  966.           special case and are inside if and only if the polygon
  967.           interior is immediately below (y increasing direction).
  968.  
  969.           The arc-mode controls filling in the _X_F_i_l_l_A_r_c_s function and
  970.           can be set to _A_r_c_P_i_e_S_l_i_c_e or _A_r_c_C_h_o_r_d.  For _A_r_c_P_i_e_S_l_i_c_e, the
  971.           arcs are pie-slice filled.  For _A_r_c_C_h_o_r_d, the arcs are chord
  972.           filled.
  973.  
  974.           The graphics-exposure flag controls _G_r_a_p_h_i_c_s_E_x_p_o_s_e event
  975.           generation for _X_C_o_p_y_A_r_e_a and _X_C_o_p_y_P_l_a_n_e requests (and any
  976.           similar requests defined by extensions).
  977.  
  978.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  979.           _B_a_d_A_l_l_o_c  The server failed to allocate the requested
  980.                     resource or server memory.
  981.  
  982.           _B_a_d_D_r_a_w_a_b_l_e
  983.                     A value for a Drawable argument does not name a
  984.                     defined Window or Pixmap.
  985.  
  986.  
  987.  
  988.      Page 9                                          (printed 10/3/02)
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.      (((())))                        UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                        (((())))
  996.  
  997.  
  998.  
  999.           _B_a_d_F_o_n_t   A value for a Font or GContext argument does not
  1000.                     name a defined Font.
  1001.  
  1002.           _B_a_d_G_C     A value for a GContext argument does not name a
  1003.                     defined GContext.
  1004.  
  1005.           _B_a_d_M_a_t_c_h  An _I_n_p_u_t_O_n_l_y window is used as a Drawable.
  1006.  
  1007.           _B_a_d_M_a_t_c_h  Some argument or pair of arguments has the correct
  1008.                     type and range but fails to match in some other
  1009.                     way required by the request.
  1010.  
  1011.           _B_a_d_P_i_x_m_a_p A value for a Pixmap argument does not name a
  1012.                     defined Pixmap.
  1013.  
  1014.           _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of
  1015.                     values accepted by the request.  Unless a specific
  1016.                     range is specified for an argument, the full range
  1017.                     defined by the argument's type is accepted.  Any
  1018.                     argument defined as a set of alternatives can
  1019.                     generate this error.
  1020.  
  1021.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1022.           AllPlanes(3X11), XCopyArea(3X11), XCreateRegion(3X11),
  1023.           XDrawArc(3X11), XDrawLine(3X11), XDrawRectangle(3X11),
  1024.           XDrawText(3X11), XFillRectangle(3X11), XQueryBestSize(3X11),
  1025.           XSetArcMode(3X11), XSetClipOrigin(3X11),
  1026.           XSetFillStyle(3X11), XSetFont(3X11),
  1027.           XSetLineAttributes(3X11), XSetState(3X11), XSetTile(3X11)
  1028.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.      Page 10                                         (printed 10/3/02)
  1055.  
  1056.  
  1057.  
  1058.